import request from "../utils/request";

export const register = (user) => {
  return request({
    url: "/system/register",
    method: "post",
    data: user,
  });
};

export const login = (id, password, type) => {
  return request({
    url: "/system/login",
    method: "post",
    params: {
      id,
      password,
      type
    },
  });
}

// 修改信息
export const modifiedUserInfo = (userType,userId,avatar) => {
  return request({
    url: "/system/modified",
    method: "post",
    params: {
      userType,
      userId,
      avatar
    }
  });
};

// 获取当前用户信息
export const getCurrentUser = (userType,userId) => {
  return request({
    url: "/system/getUser",
    method: "get",
    params:{
      userType,
      userId
    }
  })
}
